{% extends "mall/base.html" %}

{% block title %}
    {{ text }}
{% endblock %}

{% block css %}
    <link rel="stylesheet" href="{{ STATIC_URL }}/static/css/pad_mall/goods-detail.css?v={{ version_code }}">
    <style>
        .image-container {
            background: white;
            width: 600px;
            float: left;
        }

        .weui-photo-browser-modal .photo-container img {
            margin: 0 auto;
        }

        .weui-navbar__item {
            color: black;
        }

        .weui-navbar__item.weui-bar__item_on {
            border-top: 2px solid #FF0036;
            background: white;
            color: #FF0036;
        }
    </style>
{% endblock %}

{% block header %}
    {% if not view %}
        {% include 'component/pad-suspend.html' %}
    {% endif %}

{% endblock %}

{% block content %}
    <input type="hidden" name="device_id" value="{{ open_id }}">

    <div class="swiper-container image-container" data-space-between='10' data-pagination='.swiper-pagination'
         data-autoplay="1000">
        <div class="swiper-wrapper">
            {% for foo in goods_imgs %}
                <div class="swiper-slide" style="height: 512px;text-align: center;overflow: auto">
                    <img src="{{ foo }}" height="512" alt=""></div>
            {% endfor %}
        </div>
        <div class="swiper-pagination swiper-pagination-bullets">
        </div>
    </div>
    <div id="part_main">
        <div class="buy_area" id="buyArea">
            <div class="fn_wrap">
                <h1 class="fn fn_goods_name" id="favWrap">
                    <div class="fn_text_wrap" id="itemName">{{ goods.sdef_goods_name }}
                    </div>
                </h1>
                <div class="desc right_shorter" id="itemDesc" ptag="7001.1.59">{{ goods.sdef_goods_describe }}
                </div>
            </div>
            <div id="priceWrap">
                <div class="price_wrap" id="priceBlock">
                    <span class="hide" id="priceTitle"></span>
                    <span class="price" id="priceSale">¥<em>{{ goods.sdef_goods_price }}</em><i style="color:#731112; visibility: hidden">(会员¥{{ goods.sdef_goods_member_price }})</i></span>
                </div>
            </div>
            <div class="de_pm">
                <!--送货地址-->
                {% if not view %}
                    <div class="detail_transfer" id="sendArea">
                        <div class="detail_transfer_row">
                            <i class="detail_transfer_row_link"></i>
                            <span class="detail_transfer_row_tit">送至</span>
                            <div class="detail_transfer_row_content">
                                <p class="detail_transfer_row_content_oline" style="text-decoration: underline">
                                    {% if address %}
                                        {{ address.sdef_address_province }} {{ address.sdef_address_city }}
                                        {{ address.sdef_address_county }}
                                        {{ address.sdef_address_detail }}
                                    {% else %}
                                        您还没设置收货地址哦～，立即设置
                                    {% endif %}
                                </p>
                            </div>
                        </div>
                        <div class="detail_transfer_row" id="weightArea" style="visibility: hidden;">
                            <span class="detail_transfer_row_tit">库存</span>
                            <div class="detail_transfer_row_content">
                                <p id="weightVal">{{ goods.sdef_goods_count }}</p>
                            </div>
                        </div>
                    </div>
                {% endif %}


                <div class="detail_gap"></div>
                <div class="sku_container sku_container_on" id="skuCont">
                    <div class="sku_wrap">
                        {#                        <div id="propertyDiv">#}
                        {#                            <div class="sku" id="sku1" ptag="7001.1.5"><h3>重量</h3>#}
                        {#                                <div class="sku_list"><span class="option option_selected" no="1"#}
                        {#                                                            dis="0">{{ goods.sdef_goods_weight }}kg/件</span></div>#}
                        {#                            </div>#}
                        {#                        </div>#}
                        {% if not view %}
                            <div class="sku sku_num" id="skuNum">
                                <h3>数量</h3>
                                <div class="num_wrap">
                                    <span class="minus cart-count-control" data-value="-1"></span>
                                    <input class="num" id="goodsCount" data-id="{{ goods.sdef_goods_id }}" type="text"
                                           readonly="readonly" value="1">
                                    <span class="plus cart-count-control" data-value="1"></span>
                                </div>
                            </div>
                        {% endif %}

                    </div>
                </div>
            </div>

        </div>
        <div class="detail_gap" style="position: relative;width: 100%;min-height: 100px;clear: both;margin-top:250px;">
            <div class="weui-navbar">
                <div class="weui-navbar__item weui-bar__item_on" data-img="0">
                    商品介绍
                </div>
                <div class="weui-navbar__item" data-img="1">
                    恒温红酒
                </div>
                <div class="weui-navbar__item" data-img="2">
                    特色服务
                </div>
            </div>
            <div id="divGoodsDetail" style="padding-top: 50px;text-align: center;color: grey">
                加载中...
            </div>
        </div>
        <br>
        <br>
        <br>
        <br>
        {% if not view %}
            <div class="de_btn_wrap fixed" id="btnTools">
                <div class="de_row de_btn_bar">
                    {% if source != "ds" %}
                        <div class="icon_btn icon_cart_v2" onclick="location.href='/cart?device_id={{ open_id }}'">
                            <span class="add_num" id="popone">+1</span>
                            <i style="color: white;font-size:25px;" class="fa fa-shopping-cart" aria-hidden="true"></i>
                            <span class="txt">购物车</span>
                        </div>
                    {% endif %}
                    <div class="de_span btn_group">
                        <div class="de_row">
                            <div class="btn btn_orange" id="addToCart"><span class="txt">加入购物车</span>
                            </div>
                            <div class="btn btn_buy" id="btnBuy" data-id="{{ goods.sdef_goods_id }}"><span class="txt">立即购买</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}

{% block footer %}
{% endblock %}

{% block js %}
    <script>
        var IMAGES ={{ goods_imgs }};
        var GOODS_TITLE = "{{goods.sdef_goods_name  }}";
        var GOODS_DETAIL_IMAGES = '{{ goods.sdef_goods_img_intro }}';
        var LOADING_IMG = "{{ STATIC_URL }}/static/img/loading.gif";
    </script>
    <script src="{{ STATIC_URL }}/static/js/pad_mall/goods-detail.js?v={{ version_code }}"></script>
{% endblock %}